import axios from '@/http.ts'

const startPlaySong = (item, store) => {
  console.log(item)

  const { id, singer, name, picUrl, duration } = item
  axios
    .get('/song/url', {
      params: {
        id
      }
    })
    .then(res => {
      store.commit('changePlayInfo', {
        isplay: true,
        playImg: picUrl,
        playSinger: singer,
        playSongName: name,
        totalTime: duration,
        currentTime: '0',
        playSrc: res.data.data[0].url
      })
    })
}
export default startPlaySong
